3.167 \(\int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx\)

Optimal. Leaf size=89 \[ \frac {2 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \sqrt {2} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d} \]

[Out]

2*A*arctan(a^(1/2)*tan(d*x+c)/(a-a*sec(d*x+c))^(1/2))/d/a^(1/2)-2*A*arctan(1/2*a^(1/2)*tan(d*x+c)*2^(1/2)/(a-a
*sec(d*x+c))^(1/2))*2^(1/2)/d/a^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3904, 3887, 481, 203} \[ \frac {2 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \sqrt {2} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d} \]

Antiderivative was successfully verified.

[In]

Int[(A + A*Sec[c + d*x])/Sqrt[a - a*Sec[c + d*x]],x]

[Out]

(2*A*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a - a*Sec[c + d*x]]])/(Sqrt[a]*d) - (2*Sqrt[2]*A*ArcTan[(Sqrt[a]*Tan[c
 + d*x])/(Sqrt[2]*Sqrt[a - a*Sec[c + d*x]])])/(Sqrt[a]*d)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 481

Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> -Dist[(a*e^n)/(b*c -
a*d), Int[(e*x)^(m - n)/(a + b*x^n), x], x] + Dist[(c*e^n)/(b*c - a*d), Int[(e*x)^(m - n)/(c + d*x^n), x], x]
/; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1]

Rule 3887

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[(-2*a^(m/2 +
 n + 1/2))/d, Subst[Int[(x^m*(2 + a*x^2)^(m/2 + n - 1/2))/(1 + a*x^2), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 3904

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[(-(a*c))^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps

\begin {align*} \int \frac {A+A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx &=-\left ((a A) \int \frac {\tan ^2(c+d x)}{(a-a \sec (c+d x))^{3/2}} \, dx\right )\\ &=\frac {(2 a A) \operatorname {Subst}\left (\int \frac {x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}\\ &=-\frac {(2 A) \operatorname {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}+\frac {(4 A) \operatorname {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {2 \sqrt {2} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.64, size = 140, normalized size = 1.57 \[ -\frac {i A \left (-1+e^{i (c+d x)}\right ) \left (\sqrt {2} \sinh ^{-1}\left (e^{i (c+d x)}\right )-4 \tanh ^{-1}\left (\frac {1+e^{i (c+d x)}}{\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}}\right )+\sqrt {2} \tanh ^{-1}\left (\sqrt {1+e^{2 i (c+d x)}}\right )\right )}{\sqrt {2} d \sqrt {1+e^{2 i (c+d x)}} \sqrt {a-a \sec (c+d x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + A*Sec[c + d*x])/Sqrt[a - a*Sec[c + d*x]],x]

[Out]

((-I)*A*(-1 + E^(I*(c + d*x)))*(Sqrt[2]*ArcSinh[E^(I*(c + d*x))] - 4*ArcTanh[(1 + E^(I*(c + d*x)))/(Sqrt[2]*Sq
rt[1 + E^((2*I)*(c + d*x))])] + Sqrt[2]*ArcTanh[Sqrt[1 + E^((2*I)*(c + d*x))]]))/(Sqrt[2]*d*Sqrt[1 + E^((2*I)*
(c + d*x))]*Sqrt[a - a*Sec[c + d*x]])

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 305, normalized size = 3.43 \[ \left [\frac {\sqrt {2} A a \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} - {\left (3 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )}{{\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}\right ) - A \sqrt {-a} \log \left (\frac {2 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} - {\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{\sin \left (d x + c\right )}\right )}{a d}, \frac {2 \, {\left (\sqrt {2} A \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - A \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )\right )}}{a d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[(sqrt(2)*A*a*sqrt(-1/a)*log(-(2*sqrt(2)*(cos(d*x + c)^2 + cos(d*x + c))*sqrt((a*cos(d*x + c) - a)/cos(d*x + c
))*sqrt(-1/a) - (3*cos(d*x + c) + 1)*sin(d*x + c))/((cos(d*x + c) - 1)*sin(d*x + c))) - A*sqrt(-a)*log((2*(cos
(d*x + c)^2 + cos(d*x + c))*sqrt(-a)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c)) - (2*a*cos(d*x + c) + a)*sin(d*x
+ c))/sin(d*x + c)))/(a*d), 2*(sqrt(2)*A*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*cos(d*
x + c)/(sqrt(a)*sin(d*x + c))) - A*sqrt(a)*arctan(sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a
)*sin(d*x + c))))/(a*d)]

________________________________________________________________________________________

giac [C]  time = 1.13, size = 166, normalized size = 1.87 \[ -\frac {2 \, {\left (A {\left (\frac {\sqrt {2} \arctan \left (\frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{\sqrt {a}}\right )}{\sqrt {a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} - \frac {\arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{2 \, \sqrt {a}}\right )}{\sqrt {a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}\right )} + \frac {{\left (\sqrt {2} A \sqrt {a} \arctan \left (-i\right ) - A \sqrt {a} \arctan \left (-\frac {1}{2} i \, \sqrt {2}\right )\right )} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}{a}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

-2*(A*(sqrt(2)*arctan(sqrt(a*tan(1/2*d*x + 1/2*c)^2 - a)/sqrt(a))/(sqrt(a)*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)*sgn
(tan(1/2*d*x + 1/2*c))) - arctan(1/2*sqrt(2)*sqrt(a*tan(1/2*d*x + 1/2*c)^2 - a)/sqrt(a))/(sqrt(a)*sgn(tan(1/2*
d*x + 1/2*c)^2 - 1)*sgn(tan(1/2*d*x + 1/2*c)))) + (sqrt(2)*A*sqrt(a)*arctan(-I) - A*sqrt(a)*arctan(-1/2*I*sqrt
(2)))*sgn(tan(1/2*d*x + 1/2*c))/a)/d

________________________________________________________________________________________

maple [A]  time = 1.54, size = 120, normalized size = 1.35 \[ \frac {A \left (\arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {2}+\arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right )\right ) \sqrt {\frac {a \left (-1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \left (1+\cos \left (d x +c \right )\right ) \sqrt {2}}{d \sin \left (d x +c \right ) a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x)

[Out]

A/d*(arctan(1/(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2))*2^(1/2)+arctan(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*2^
(1/2)))*(a*(-1+cos(d*x+c))/cos(d*x+c))^(1/2)*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)*(1+cos(d*x+c))/sin(d*x+c)/a*
2^(1/2)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+A*sec(d*x+c))/(a-a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: sign: argument cannot be imaginary
; found %i

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {A+\frac {A}{\cos \left (c+d\,x\right )}}{\sqrt {a-\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + A/cos(c + d*x))/(a - a/cos(c + d*x))^(1/2),x)

[Out]

int((A + A/cos(c + d*x))/(a - a/cos(c + d*x))^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ A \left (\int \frac {\sec {\left (c + d x \right )}}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx + \int \frac {1}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+A*sec(d*x+c))/(a-a*sec(d*x+c))**(1/2),x)

[Out]

A*(Integral(sec(c + d*x)/sqrt(-a*sec(c + d*x) + a), x) + Integral(1/sqrt(-a*sec(c + d*x) + a), x))

________________________________________________________________________________________